package com.xinqi.modules.course.textbook.client;

import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.course.textbook.dto.req.CourseCloudTextbookContentCreateDTO;
import com.xinqi.modules.course.textbook.dto.req.CourseCloudTextbookContentQueryDTO;
import com.xinqi.modules.course.textbook.dto.req.CourseCloudTextbookContentUpdateDTO;
import com.xinqi.modules.course.textbook.dto.rsp.CourseCloudTextbookContentResultDTO;
import com.xinqi.modules.course.textbook.factory.CourseCloudTextbookContentFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 课程模块云课本课堂内容客户端
 *
 * @author: wenjie
 * @date: 2023/05/30
 */
@FeignClient(value = ServiceNameConstants.XQ_COURSE, fallbackFactory = CourseCloudTextbookContentFallbackFactory.class)
public interface CourseCloudTextbookContentClient {

    /**
     * 课程模块云课本课堂内容-分页
     */
    @GetMapping("/course-cloud-textbook-content/page")
    R<PageInfo<CourseCloudTextbookContentResultDTO>> page(CourseCloudTextbookContentQueryDTO dto);

    /**
     * 课程模块云课本课堂内容-详情
     */
    @GetMapping("/course-cloud-textbook-content/{id}")
    R<CourseCloudTextbookContentResultDTO> findById(@PathVariable("id") Long id);

    /**
     * 新增课程模块云课本课堂内容
     */
    @PostMapping("/course-cloud-textbook-content")
    R<Long> insert(@RequestBody CourseCloudTextbookContentCreateDTO dto);

    /**
     * 修改课程模块云课本课堂内容
     */
    @PutMapping("/course-cloud-textbook-content/{id}")
    public R<Boolean> update(@PathVariable("id") Long id, @RequestBody CourseCloudTextbookContentUpdateDTO dto);

    /**
     * 删除课程模块云课本课堂内容
     */
    @DeleteMapping("/course-cloud-textbook-content/{id}")
    R<Boolean> delete(@PathVariable("id") Long id);

}
